package com.kele.service.impl;

import com.kele.dao.MessageDao;
import com.kele.domain.User;
import com.kele.domain.messages;
import com.kele.service.MessagesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 创作人 王箫凯
 * Date 2021/6/14
 * Time 16:24
 *
 * @author 王箫凯
 */
@Service
public class MessagesServiceImpl implements MessagesService {
    @Resource
    MessageDao messageDao;

    @Override
    public int createChatRoom(String account, String roomNumber) {

        return messageDao.createChatRoom(account,roomNumber);
    }

    @Override
    public int invitedUserJoin(String invitedAccount, String roomNumber, int code) {
        return messageDao.invitedUserJoin(invitedAccount,roomNumber,code);
    }

    @Override
    public int doInvited(String account, String roomNumber, int code) {
        return messageDao.doInvited(account,roomNumber,code);
    }

    @Override
    public messages selectByRoomNumber(String roomNumber, String otherAccount) {
        return messageDao.selectByRoomNumber("roomNumber","otherAccount");
    }

    @Override
    public int sendMessages(String message, String roomNumber, String myAccount, String myNickName) {
        return messageDao.sendMessages(message,roomNumber, myAccount, myNickName);
    }

    @Override
    public int selectRoom(String account, String roomNumber) {
        return messageDao.selectRoom(account,roomNumber);
    }

    @Override
    public List<messages> myMessages(String account) {
        return messageDao.myMessages(account);
    }

    @Override
    public List<messages> selectMessagesWith(String roomNumber, String account) {
        return messageDao.selectMessagesWith(roomNumber,account);
    }

    @Override
    public int deleteMessageRoom(String roomNumber, String account) {
        return messageDao.deleteMessageRoom(roomNumber,account);
    }

    @Override
    public int invitedCode(String account, String roomNumber) {
        return messageDao.invitedCode(account,roomNumber);
    }
}
